#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2018-08-21 10:35:51
# @Author  : yangchaojun (YYChildren@gmail.com)
# @Link    : https://git.mingchao.com/yangchaojun
# @Version : 

# mysql
import pymysql
import pandas as pd
### 网贷平台评论.xlsx
import pandas as pd
from tqdm import tqdm
from mtmodel.utils import store, pd_source

df_comment = pd.read_excel('/home/mingchao/lcs_data/网贷平台评论.xlsx')


trg_db='lcs_shijian'
trg_table='s_lcs_finance_comment'
for index in tqdm(df_comment.index):
    row = df_comment.iloc[index]
    kv = dict(
        comment_id = str(row['评论ID']),
        content = str(row['评论内容']),
        source = str(row['平台名称']), 
        comment_time = str(row['发布时间']),
        user_name = str(row['用户名称']),         
        )
    store.to_mysql(kv, trg_db, trg_table)
